package com.wt.common;

public class ResultData {
	
	private int status;
	
	private String msg;
	
	private Object data;
	
	public ResultData(){
		
	}
	
	public ResultData(int status, String msg, Object data){
		this.status = status;
		this.msg = msg;
		this.data = data;
	}
	
	public static ResultData build(int status,String msg){
		return new ResultData(status, msg, null);
	}
	
	public static ResultData build(int status,String msg,Object data){
		return new ResultData(status, msg, data);
	}
	
	public static ResultData success(){
		return new ResultData(0, "success",null);
	}
	
	public static ResultData success(String msg){
		return new ResultData(0, msg,null);
	}
	
	public static ResultData success(Object data){
		return new ResultData(0, "success", data);
	}
	
	public static ResultData success(String msg,Object data){
		return new ResultData(0, msg, data);
	}
	
	public static ResultData fail(){
		return new ResultData(-1, "failure", null);
	}
	
	public static ResultData fail(String msg){
		return new ResultData(-1, msg, null);
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}
	

}
